<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="top.lionkliu.entity.User" %>
<%@ page import="top.lionkliu.utils.SystemConstants" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <title>管理员</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/bootstrap/css/bootstrap.min.css">
    <script src="<%=request.getContextPath()%>/static/js/jquery.js"></script>
    <script src="<%=request.getContextPath()%>/static/bootstrap/js/bootstrap.js"></script>
</head>
<body>
<%
    User loginUser = (User) session.getAttribute("loginUser");
    String flag = loginUser.getFlag();
%>


<nav class="navbar navbar-expand-lg navbar-light"
     style="background-color: #f8f9fa;height: 60px;border-bottom:1px solid #e7e7e7;">
    <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
        <svg style="margin-left: 5px" t="1652251538337" class="icon" viewBox="0 0 1205 1024" version="1.1"
             xmlns="http://www.w3.org/2000/svg"
             p-id="1980" height="50" width="50">
            <path d="M1078.57868 1018.80203c-23.390863 0-54.57868-10.395939-88.365482-20.791878-23.390863-7.796954-62.375635-20.791878-72.771574-15.593908-59.77665 20.791878-122.152284 31.187817-187.126903 31.187817-83.167513 0-163.736041-18.192893-233.90863-51.979696-12.994924-5.19797-18.192893-20.791878-12.994923-33.786802 5.19797-12.994924 20.791878-18.192893 33.786802-12.994923 64.974619 31.187817 137.746193 46.781726 213.116751 46.781725 59.77665 0 116.954315-10.395939 171.532995-28.588832 25.989848-10.395939 62.375635 2.598985 106.558375 15.593909 20.791878 7.796954 54.57868 18.192893 70.172589 18.192893 0-10.395939-7.796954-31.187817-10.395939-44.182741-10.395939-38.984772-23.390863-72.771574-2.598985-96.162437 54.57868-59.77665 85.766497-129.949239 85.766498-205.319797 0-75.370558-31.187817-145.543147-85.766498-205.319797-10.395939-10.395939-10.395939-25.989848 0-36.385786 10.395939-10.395939 25.989848-10.395939 36.385787 0 64.974619 70.172589 101.360406 153.340102 101.360406 241.705583 0 85.766497-33.786802 168.93401-96.162436 236.507615 0 10.395939 7.796954 33.786802 10.395939 46.781726 12.994924 41.583756 25.989848 83.167513-5.19797 103.95939-10.395939 7.796954-20.791878 10.395939-33.786802 10.395939z"
                  fill="#E59797" p-id="1981"></path>
            <path d="M506.80203 31.187817c262.497462 0 473.015228 184.527919 473.015229 410.639594s-213.116751 410.639594-473.015229 410.639594c-67.573604 0-132.548223-12.994924-192.324873-33.786802-38.984772-15.593909-166.335025 57.177665-200.121827 33.786802-28.588832-20.791878 38.984772-137.746193 15.593909-163.736041-59.77665-70.172589-96.162437-155.939086-96.162437-249.502538C31.187817 215.715736 244.304569 31.187817 506.80203 31.187817z"
                  fill="#FDDFDF" p-id="1982"></path>
            <path d="M135.147208 881.055838c-12.994924 0-23.390863-2.598985-33.786802-10.39594-31.187817-20.791878-18.192893-64.974619-5.197969-111.756345 5.19797-18.192893 12.994924-46.781726 12.994923-57.177665C41.583756 628.954315 7.796954 537.989848 7.796954 441.827411 7.796954 200.121827 231.309645 5.19797 506.80203 5.19797S1005.807107 200.121827 1005.807107 441.827411s-223.51269 436.629442-499.005077 436.629442c-70.172589 0-137.746193-12.994924-200.121827-36.385787-10.395939-2.598985-54.57868 10.395939-77.969543 18.192893-36.385787 10.395939-67.573604 20.791878-93.563452 20.791879z m0-51.979696c15.593909 0 51.979695-12.994924 77.969543-20.791878 46.781726-15.593909 85.766497-28.588832 114.35533-18.192893 57.177665 20.791878 119.553299 33.786802 181.928934 33.786802 246.903553 0 447.025381-171.532995 447.025381-384.649747S753.705584 57.177665 506.80203 57.177665 59.77665 228.71066 59.77665 441.827411c0 83.167513 31.187817 163.736041 90.964467 231.309645 20.791878 23.390863 10.395939 59.77665-2.598985 103.959391-5.19797 15.593909-12.994924 41.583756-12.994924 51.979695z"
                  fill="#EE9B9B" p-id="1983"></path>
            <path d="M254.700508 397.64467c31.187817 0 54.57868 25.989848 54.57868 57.177665 0 31.187817-25.989848 57.177665-54.57868 57.177665s-54.57868-25.989848-54.578681-57.177665c0-31.187817 23.390863-57.177665 54.578681-57.177665z"
                  fill="#EE9B9B" p-id="1984"></path>
            <path d="M506.80203 397.64467c31.187817 0 54.57868 25.989848 54.578681 57.177665 0 31.187817-25.989848 57.177665-54.578681 57.177665s-54.57868-25.989848-54.57868-57.177665c-2.598985-31.187817 23.390863-57.177665 54.57868-57.177665z"
                  fill="#E59797" p-id="1985"></path>
            <path d="M758.903553 397.64467c31.187817 0 54.57868 25.989848 54.578681 57.177665 0 31.187817-25.989848 57.177665-54.578681 57.177665s-54.57868-25.989848-54.57868-57.177665c-2.598985-31.187817 23.390863-57.177665 54.57868-57.177665z"
                  fill="#DD9393" p-id="1986"></path>
        </svg>
        <%
            if (flag.equals(SystemConstants.IS_ADMIN)) {
        %>
        <%--管理员导航栏--%>
        <a class="btn btn-light" href="<%=request.getContextPath()%>/admin/index.jsp">首页 </a>
        <a class="btn btn-light" href="<%=request.getContextPath()%>/admin/note.jsp">留言板 </a>
        <a class="btn btn-light" href="<%=request.getContextPath()%>/admin/userManage.jsp">后台管理 </a>
        <%
        } else {
        %>
        <%--普通用户导航栏--%>
        <a class="btn btn-light" href="<%=request.getContextPath()%>/user/index.jsp">首页 </a>
        <a class="btn btn-light" href="<%=request.getContextPath()%>/user/note.jsp">留言板 </a>
        <%
            }
        %>
    </div>

    <%--用户信息--%>
    <a class="navbar-brand btn btn-light" href="<%=request.getContextPath()%>/common/UserInfo.jsp">
        <img src="<%=loginUser.getImage()%>" style=" border-radius:50%" width="30" height="30"/>
        <span style="color: #ff70a2">
            <%
                if (flag.equals(SystemConstants.IS_ADMIN)) {
            %>
            <span>管理员：</span>
            <%
            } else {
            %>
            <span>普通用户：</span>
            <%
                }
            %>
            <%=loginUser.getName()%>
        </span>
    </a>
    <%--退出登录--%>
    <a class="col-md-1 btn btn-light" href="<c:url value="/LogoutServlet"/>">退出登录</a>
</nav>
</body>
</html>
